home *** CD-ROM | disk | FTP | other *** search
- /* JoinNewGroup.thor by Neil Bothwick */
- /* $VER: JoinNewGroup.thor 1.0a (21.06.96) */
- /* Presents the contents of a NewGroups message in a */
- /* listview and creates join events for those selected */
-
- options results
-
- /* needs THOR and bbsread.library functions */
-
- thorport = address()
- if left(thorport,5) ~= 'THOR.' then do
- say 'No THOR port found. This script must be run from Thor.'
- exit 10
- end
-
- if ~show('p', 'BBSREAD') then do
- address command
- 'run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead'
- 'WaitForPort BBSREAD'
- end
-
- address(thorport)
- drop MSG.
- CURRENTMSG stem MSG /* Get info on current message */
- if rc ~= 0 then ExitMsg(THOR.LASTERROR)
- if upper(MSG.CONFNAME) ~= 'INFORMATION' then ExitMsg('This script only works from the Information conference')
-
- address(bbsread) /* Read list of new newsgroups */
- drop TEXT.
- READBRMESSAGE bbsname '"'MSG.BBSNAME'"' confname '"'MSG.CONFNAME'"' msgnr MSG.MSGNR textstem TEXT
-
- address(thorport)
- drop PICKED.
- REQUESTLIST instem TEXT.TEXT outstem PICKED /* Show new groups in a listview */
-
- if RC = 5 then ExitMsg('No newsgroup selected')
- if RC > 0 then ExitMsg(THOR.LASTERROR)
-
- NewGroup = RESULT
-
- address(bbsread)
- drop NEWEVENT. /* Create join event */
- NEWEVENT.CONFERENCE = NewGroup
- WRITEBREVENT bbsname '"'MSG.BBSNAME'"' event 2 stem NEWEVENT
- if rc ~= 0 then ExitMsg(BBSREAD.LASTERROR)
-
- address(thorport)
- REQUESTNOTIFY '"'NewGroup' joined"' '"OK"'
-
- exit
-
- ExitMsg:
- address(thorport)
- parse arg errmsg
- REQUESTNOTIFY '"'errmsg'"' '" OK "'
- exit
-
-